#ifndef __FPGA_H
#define __FPGA_H
#define FPGA_LINE_END           GPIO_Pin_5     // PC13              
#define FPGA_READ               GPIO_Pin_14     //PE14  
#define FPGA_WRITE              GPIO_Pin_15     // PE15              
#define FPGA_RST                GPIO_Pin_6     // PC12               
#define FPGA_ENABLE_PRINT       GPIO_Pin_12     // PE12
#define INK_POWER               GPIO_Pin_15     //PC15
//#define FPGA_INK1_BUSY          GPIO_Pin_12     //PE12
//#define FPGA_INK2_BUSY          GPIO_Pin_14     //PC14

#define INK_POWER_ON            GPIOC->BSRR = INK_POWER
#define INK_POWER_OFF           GPIOC->BRR  = INK_POWER

#define Enable_FPGA_Print       GPIOE->BSRR = FPGA_ENABLE_PRINT               
#define Disable_FPGA_Print      GPIOE->BRR= FPGA_ENABLE_PRINT

//#define Enable_FPGA_Print       GPIOC->BSRR = GPIO_Pin_5             
//#define Disable_FPGA_Print      GPIOC->BRR= GPIO_Pin_5 

#define FPGA_FULL               GPIO_Pin_13     //PE13
#define Read_FPGA_FULL          GPIOE->IDR&FPGA_FULL
#define FPGA_STAT               GPIO_Pin_4    //PC15 
#define Read_FPGA_STAT          GPIOC->IDR&FPGA_STAT
#define fpga_Data_Port          GPIOD

void FPGA_Init( void );
void Read_fpga(short * Readbuf,unsigned int len);
void Write_fpga(short * Writebuf,unsigned int len,unsigned char EndFlag);
void FPGA_Reset( void );
void Write_fpga_Compress(char * Writebuf,unsigned int len,unsigned char EndFlag);
#endif
